<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.jiabonet.DB.staticBean"%>
<%
String path = request.getContextPath();
String Admin = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+staticBean.getAdminDir();
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>添加仓库信息</title>
	<link href="<%=path%>/Public/css/AdminCss.css" rel="stylesheet" type="text/css" />
		<script src="<%=path%>/Public/js/jquery.min.js" type="text/javascript"></script>
		<!--<script src="<%=path%>/Public/js/jquery.form.js"></script>-->
		<!--<script src="<%=path%>/Public/js/admin_login_add.js" type="text/javascript"></script>-->
<script type="text/javascript">
$(function(){
	$("#tables tr").hover(
	  function () {
		$(this).css("background","#d5f4fe");
	  },
	  function () {
		$(this).css("background","#fff");
	  }
	);

	
	var storageName = $("input[id='StorageName']");
	
	var content = $("#Content");
	var send = $("#send");	
	var str= new Array();
	var manage = $("#man");
	
	storageName.blur(function (){
		if(storageName.val().length>0){
			$.ajax({
				   type: "POST",
				   url: "<%=path%>/Storage!Storage_UserIs.action?T="+Math.random(),
				   data: "storage.StorageName="+storageName.val(),
				   success: function(msg){
						 $("#IsName").show();
						 if(msg.isOK==1){
						 	$("#IsName1").html(msg.returnInfo).css("color","#69D172");
						 }else{
							$("#IsName1").html(msg.returnInfo).css("color","red");
							storageName.focus();
							return false;
						 }
						 //alert(msg.returnInfo);
				   }
				});
		}else{
			$("#IsName").show();
			$("#IsName1").html("<font color=red>仓库名称格式错误，请重新输入!</font>");
			return false;
		}				
	
	});
	
	//点击确定按钮
	send.click(function(){	
		
		if(storageName.val().length==0||storageName.val().length<2){
			$("#IsName").show();
			$("#IsName1").html("<font color=red>仓库名称不能为空或小于2位，请重新输入!</font>");
			return false;
		}else{
			var datas="storage.StorageName="+storageName.val()+"&storage.Manage="+manage.val()+
			"&storage.Content="+content.val();	
			//alert(datas);
			$.ajax({
			   type: "POST",
			   url: "<%=path%>/Storage!Storage_UserAdd.action?T="+Math.random(),
			   data: datas,
			   success: function(msg){
				   	//alert(msg.returnInfo);
					$("#IsSend").show();
					$("#IsSend1").html(msg.returnInfo).css("color","#69D172");
					storageName.val("");
			   }
			});
		}
		
	});

	
});
</script>


	</head>
	<body>
		<table width="100%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="30">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td height="24" bgcolor="#353c44">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td>
											<table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td width="6%" height="24" valign="center">
														<div align="center">
															s<img src="<%=Admin%>/images/tb.gif" width="14"
																height="14" />
														</div>
													</td>
													<td width="94%" height="24" valign="center">
														<span class="STYLE1"> <strong>添加仓库信息</strong> </span>
													</td>
												</tr>
											</table>
										</td>
										<td>
											<div align="right">
												<span class="STYLE1"> &nbsp;&nbsp;<img
														src="<%=Admin%>/images/edit.gif" width="10" height="10" />
													当前用户：<%=session.getAttribute("Username")%> &nbsp;</span><span
													class="STYLE1"> &nbsp;</span>
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellpadding="0" cellspacing="1"
						bgcolor="#a8c7ce" id="tables">
						<tr height="30">
							<td width="14%" bgcolor="d3eaef" class="STYLE6">
								<div align="center">
									<span class="STYLE10">仓库名称：</span>
								</div>
							</td>
							<td width="34%" bgcolor="d3eaef" class="STYLE6">
								<div align="left">
									<span class="STYLE10" style="margin-left: 15px;"> <input
											type="text" value="" name="storage.StorageName"
											id="StorageName" maxlength="32" size="24" /> <input
											type="hidden" value="<%=request.getRemoteAddr()%>" name="Ip"
											maxlength="32" size="24" /> </span>
								</div>
							</td>
							<td width="52%" bgcolor="d3eaef" class="STYLE6">
								<div align="left">
									<span class="STYLE10" style="margin-left: 15px;">（仓库名称不能为空）</span>
								</div>
							</td>
						</tr>
						<tr bgcolor="#ffffff" height="30" id="IsName"
							style="display: none;">
							<td colspan="3" bgcolor="#ffffff" class="STYLE6">
								<div align="left" style="padding-left: 50px;">
									<span class="STYLE10" id="IsName1"> </span>
								</div>
							</td>
						</tr>
						


						<tr bgcolor="#ffffff" height="30">
							<td width="14%" class="STYLE6">
								<div align="center">
									<span class="STYLE10">主管人员：</span>
								</div>
							</td>
							<td width="34%" class="STYLE6">
								<div align="left">
									<span class="STYLE10" style="margin-left: 15px;"> <select
											name="man" id="man">
											<s:iterator value="List" id="user">
												<option value="<s:property value="#user.Name"/>">
													<s:property value="#user.Name" />
												</option>
											</s:iterator>
										</select> </span>
								</div>
							</td>
							<td width="52%" class="STYLE6">
								<div align="left">
									<span class="STYLE10" style="margin-left: 15px;">（选择主管人员）</span>
								</div>
							</td>
						</tr>



						<tr bgcolor="#ffffff" height="30" id="IsUserName"
							style="display: none;">
							<td colspan="3" bgcolor="#ffffff" class="STYLE6">
								<div align="left" style="padding-left: 50px;">
									<span class="STYLE10" id="IsUserName1"> </span>
								</div>
							</td>
						</tr>

						<tr bgcolor="#ffffff" height="50">
							<td width="14%" class="STYLE6">
								<div align="center">
									<span class="STYLE10">使用说明：</span>
								</div>
							</td>
							<td width="34%" class="STYLE6">


								<div align="left">

									<span class="STYLE10" style="margin-left:15px;">
									<textarea rows="5" cols="30" name="storage.Content" id="Content"></textarea></span>

								</div>

							</td>
							<td width="52%" class="STYLE6">
								<div align="left">
									<span class="STYLE10" style="margin-left: 15px;">（选填）</span>
								</div>
							</td>
						</tr>
						<tr bgcolor="#ffffff" height="30">
							<td colspan="3" bgcolor="#ffffff" class="STYLE6">
								<div align="left" style="padding-left: 50px;">
									<span class="STYLE10"> 
									<input type="submit" value="确定"
											name="send" id="send" />&nbsp;&nbsp; <input type="button"
											value="关闭" onClick="window.close();" /> </span>
								</div>
							</td>
						</tr>
						<tr bgcolor="#ffffff" height="30" id="IsSend"
							style="display: none;">
							<td colspan="3" bgcolor="#ffffff" class="STYLE6">
								<div align="left" style="padding-left: 50px;">
									<span class="STYLE10" id="IsSend1"> </span>
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>